import nci60.data.protein.Protein

def files = [new File('/home/auerf/temp/del/delAc.txt'), new File('/home/auerf/temp/del/delCdna.txt'), new File('/home/auerf/temp/del/delGene.txt')]
files.each(){file->
    file.each(){line->
        def splitted = line.split('\t')
        def prot = Protein.findById(splitted[0])
        println ''+file+'\tdel '+splitted[1]+' from '+splitted[0]
        def ref = prot.referenceIds.find{it.id==splitted[1].toInteger()}
        println ref.id+'\t'+ref
        prot.removeFromReferenceIds(ref)
        ref.delete()
        prot.save(flush:true)
    }
}